<!--
 * @description  :情报线索登记详情
 * @descriptionDetail:情报线索登记详情
 * @copyright    : 浙江烟草
 * @author       : dw
 * @create       : 2022-12-16 11:42:23
-->
<template>
  <view class="page">
    <view class="cearch_title">
      线索查看
    </view>
    <view class="content u-page" style="padding-top:86rpx">
      <u-form ref="uForm" :model="addForm" label-position="top" label-width="auto">
        <u-form-item
          label="接收时间"
          prop="regDate"
        >
          {{ detailInfo.regDate || '/' }}
        </u-form-item>
        <u-form-item
          label="来源途径"
          prop="sourceType"
        >
          {{ detailInfo.sourceTypeName || '/' }}
        </u-form-item>
        <u-form-item
          label="举报形式"
          prop="reportType"
        >
          {{ detailInfo.reportTypeName || '/' }}
        </u-form-item>

        <u-form-item label="是否举报">
          {{ detailInfo.isReport ? '是' : '否' || '/' }}
        </u-form-item>
        <u-form-item v-if="detailInfo.sourceType == K_SOURCE_TYPE.ST_06" label="受理编号" prop="acceptNo">
          {{ detailInfo.acceptNo || '/' }}
        </u-form-item>
        <u-form-item label="举报人描述">
          {{ detailInfo.reportPersonDesc || '/' }}
        </u-form-item>
        <u-form-item label="情报描述" prop="name">
          {{ detailInfo.name || '/' }}
        </u-form-item>
        <u-form-item label="登记人意见" prop="undertakerAdvice">
          {{ detailInfo.undertakerAdvice || '/' }}
        </u-form-item>
        <u-form-item label="备注">
          {{ detailInfo.remark || '/' }}
        </u-form-item>
        <u-form-item label="附件">
          <m-upload
            :uploadParam="fileUploadParam"
            upApiUrl="uploadBase64ForApp"
            :fileList="fileList"
            :disabled="true"
            :deletable="false"
            @on-list-change="changeUpload"
          ></m-upload>
        </u-form-item>
      </u-form>
    </view>
  </view>
</template>

<script>
import MUpload from "@/components/m-upload.vue";
import intelligenceservice from "@/service/intelligence/intelligence.service";
import { K_SOURCE_TYPE,}  from '@/service/intelligence/mapping/enum.js';
export default {
  components: {
    MUpload,
  },
  props: {
    detailInfo: {
      type: Object,
      default: () => {
        return {}
      },
    },
  },
  data() {
    return {
      addForm: {},
      fileUploadParam:{
        fiGroupCode:this.$FILE_GROUP_TYPE.JNSG_PIC,
        bizId:"",
      },
      fileList: [],
      K_SOURCE_TYPE:K_SOURCE_TYPE,
    }
  },
  mounted () {
    if (this.detailInfo) {
      this.fileUploadParam.bizId = this.detailInfo.uuid;
      let params = {
        bizId: this.detailInfo.uuid,
        group: this.$FILE_GROUP_TYPE.JNSG_PIC,
        menuCode: null,
      };
      intelligenceservice.findFilesByBizIdAndGroup(params).then(res => {
        if(res.success){
          this.fileList = res.data;
        }
      })
    }
  },
  methods: {
    // 上传/删除图片事件
    changeUpload(list, key){
      if(list.length > 0){
        this.fileList = [...list,];
      }else{
        this.fileList = [];
      }
    },
  },
}
</script>

<style lang="scss" scoped>
	.page{
		padding: 0;
	}
	.nav-right-icon{
		margin-right: 30rpx;
		font-size: .8rem;
		color: #FFF;
	}
	.content{
		padding: $cm_conent_padding_column $cm_content_paddng_row;
	}
	.content-padding-bottom{
		padding-bottom: 150rpx !important;
	}
	.title-gp{
		font-size: 18rpx;
		color: $u-type-error;
	}
  .cearch_title{
    background-color: #F3F4F5;
    width: 100%;
    height: 82rpx;
    font-size: 32rpx;
    font-weight: 600;
    padding: 22rpx 0 21rpx 32rpx;
    z-index: 999;
    position: fixed;
  }
</style>
